#!/bin/bash


io=$(mysql -u root -pWWW.1.com -e "show slave status\G;" 2> /dev/null  | grep "Slave_IO_Running"| awk -F: '{print $2}')
sql=$(mysql -u root -pWWW.1.com -e "show slave status\G;" 2> /dev/null  | grep "Slave_SQL_Running"|head -n 1 | awk -F: '{print $2}')
echo 'io的线程状态'
if [ $io == Yes ];then
    echo '1'
else
    echo '0'
fi
echo 'sql的线程状态'
if [ $sql == Yes ];then
    echo '1'
else
    echo '0'
fi
